﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using ControlService;

namespace BLLService
{
    [DataContract]
    public class Pager : DataContractBase
    {
        public Pager()
        {

        }

        private string _tableName;
        [DataMember]
        public string TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }

        private string _primaryKey;
        [DataMember]
        public string PrimaryKey
        {
            get { return _primaryKey; }
            set { _primaryKey = value; }
        }

        private string _showFields = " * ";
        [DataMember]
        public string ShowFields
        {
            get { return _showFields; }
            set { _showFields = value; }
        }

        private int _pageSize;
        [DataMember]
        public int PageSize
        {
            get { return _pageSize; }
            set { _pageSize = value; }
        }

        private int _pageIndex;
        [DataMember]
        public int PageIndex
        {
            get { return _pageIndex; }
            set { _pageIndex = value; }
        }

        private bool _isCount = false;

        /// <summary>
        /// False 时返回的是查询出来的结果集 True 为该结果集的记录数
        /// </summary>
        [DataMember]
        public bool IsCount
        {
            get { return _isCount; }
            set { _isCount = value; }
        }

        private string _orderFid = null;

        /// <summary>
        /// 默认按主键排序升序，格式： AF desc , BF ASC
        /// </summary>
        [DataMember]
        public string OrderFid
        {
            get { return _orderFid; }
            set { _orderFid = value; }
        }


        private string _autoOrder = "";

        /// <summary>
        /// 系统自动排序
        /// </summary>
        [DataMember]
        public string AutoOrder
        {
            get { return _autoOrder; }
            set { _autoOrder = value; }
        }

        private string _strWhere = " 1= 1";

        [DataMember]
        public string StrWhere
        {
            get { return _strWhere; }
            set { _strWhere = value; }
        }

        private string _autoWhere = "";

        [DataMember]
        public string AutoWhere
        {
            get { return _autoWhere; }
            set { _autoWhere = value; }
        }

        private bool _isReadDbSource = true;

        /// <summary>
        /// 是否读取数据数据源，默认为true
        /// </summary>
        [DataMember]
        public bool IsReadDbSource
        {
            get { return _isReadDbSource; }
            set { _isReadDbSource = value; }
        }

        private string _pageName;

        [DataMember]
        public string PageName
        {
            get { return _pageName; }
            set { _pageName = value; }
        }

        private string _filterAppName;

        /// <summary>
        /// 如果设置了该字段，则业务逻辑层自动会加入该字段的公司限制
        /// </summary>
        [DataMember]
        public string FilterAppName
        {
            get { return _filterAppName; }
            set { _filterAppName = value; }
        }

        private string _comcode;

        [DataMember]
        public string Comcode
        {
            get { return _comcode; }
            set { _comcode = value; }
        }

        private string _usercode;

        [DataMember]
        public string Usercode
        {
            get { return _usercode; }
            set { _usercode = value; }
        }
    }
}
